# #####################################################
# libjsonplus makefile 
# #####################################################
# Dmitry Sklyadev (c) 2011
# #####################################################

compile_options := -Wall -std=c++0x -pedantic -fPIC
link_options    := -shared -fPIC -Wall
includes := -I include/
libname  := libjsonplus.so
bindir   := ../libcompiled/
objlist  := cjsonarray.o 			  \
						cjsonerror.o 			  \
						cjsonobject.o 			\
						cjsonvaluebool.o 		\
						cjsonvaluenull.o 		\
						cjsonvaluestring.o 	\
						cjsonname.o 				\
						cjsonvalue.o				\
						cjsonvaluenumber.o  \
					  cjsonvaluefloat.o   \
						cjsonparser.o				\
						cjsonvalue_common.o \
						cjsondebug.o

all: $(bindir)$(libname)
	mkdir -p $(bindir)
	g++ $(link_options) $(objlist) -o $(bindir)$(libname)

$(bindir)$(libname): $(objlist) 

cjsonarray.o: cjsonarray.cpp
	g++ $(compile_options) $(includes) -c cjsonarray.cpp

cjsonerror.o: cjsonerror.cpp
	g++ $(compile_options) $(includes) -c cjsonerror.cpp

cjsonobject.o: cjsonobject.cpp
	g++ $(compile_options) $(includes) -c cjsonobject.cpp

cjsonvaluebool.o: cjsonvaluebool.cpp
	g++ $(compile_options) $(includes) -c cjsonvaluebool.cpp

cjsonvaluenull.o: cjsonvaluenull.cpp
	g++ $(compile_options) $(includes) -c cjsonvaluenull.cpp

cjsonvaluestring.o: cjsonvaluestring.cpp
	g++ $(compile_options) $(includes) -c cjsonvaluestring.cpp

cjsonname.o: cjsonname.cpp
	g++ $(compile_options) $(includes) -c cjsonname.cpp

cjsonvalue.o: cjsonvalue.cpp
	g++ $(compile_options) $(includes) -c cjsonvalue.cpp

cjsonvaluenumber.o: cjsonvaluenumber.cpp
	g++ $(compile_options) $(includes) -c cjsonvaluenumber.cpp

cjsonparser.o: cjsonparser.cpp
	g++ $(compile_options) $(includes) -c cjsonparser.cpp

cjsonvalue_common.o: cjsonvalue_common.cpp
	g++ $(compile_options) $(includes) -c cjsonvalue_common.cpp

cjsondebug.o: cjsondebug.cpp
	g++ $(compile_options) $(includes) -c cjsondebug.cpp

cjsonvaluefloat.o: cjsonvaluefloat.cpp
	g++ $(compile_options) $(includes) -c cjsonvaluefloat.cpp

clean:
	rm *.o
	rm -r $(bindir)

rebuild:
	make clean
	make all

